package com.tongji.housediy.view
{
	import com.tongji.housediy.events.commonEvent.RoomNameAdminEvent;
	import com.tongji.housediy.events.commonEvent.ShowHideTitleWindowEvent;
	import com.tongji.housediy.model.BrandModel;
	import com.tongji.housediy.model.CompEnableStateModel;
	import com.tongji.housediy.utils.DragDropManager;
	import com.tongji.housediy.view.components.CommonWindow;
	import com.tongji.housediy.view.components.DoubleDoor;
	import com.tongji.housediy.view.components.DoubleShiftDoor;
	import com.tongji.housediy.view.components.DoubleWindow;
	import com.tongji.housediy.view.components.FixedWindow;
	import com.tongji.housediy.view.components.Furniture;
	import com.tongji.housediy.view.components.ShiftDoor;
	import com.tongji.housediy.view.components.SingleDoor;
	import com.tongji.housediy.vo.Brand;
	import com.tongji.housediy.vo.GoodsSort;
	
	import flash.events.MouseEvent;
	
	import mx.binding.utils.BindingUtils;
	import mx.controls.Alert;
	
	import org.robotlegs.mvcs.Mediator;
	
	/**
	 * 
	 * @author liaoruohuai
	 * 2011-4-11
	 */
	public class FirstBrandRendererMediator extends Mediator
	{
		[Inject]
		public var view:FirstBrandItemRenderer;
		
		[Inject]
		public var enableStateModel:CompEnableStateModel;
		
		[Inject]
		public var brandModel:BrandModel;
		override public function onRegister():void
		{						
			view.moreBtn.addEventListener(MouseEvent.CLICK, ShowMoreGoodsHandler);
		}
		
		private function ShowMoreGoodsHandler(event:MouseEvent):void
		{
			enableStateModel.brandStateIndex = 1;
			brandModel.currentGoodsIndex = 0;
			brandModel.currentGoodsIndex = brandModel.goodsList.getItemIndex(view.data);
		}
	}
}